using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;

namespace Xfinity.Maths
{
    public struct BezierSurface
    {
        #region Control points
        /// <summary>
        /// A control vertex.
        /// </summary>
        public Vector3 V11, V12, V13, V14, V21, V22, V23, V24, V31, V32, V33, V34, V41, V42, V43, V44;
        #endregion

        #region Constructor
        public BezierSurface(
            Vector3 v11, Vector3 v12, Vector3 v13, Vector3 v14,
            Vector3 v21, Vector3 v22, Vector3 v23, Vector3 v24,
            Vector3 v31, Vector3 v32, Vector3 v33, Vector3 v34,
            Vector3 v41, Vector3 v42, Vector3 v43, Vector3 v44)
        {
            V11 = v11;
            V12 = v12;
            V13 = v13;
            V14 = v14;
            V21 = v21;
            V22 = v22;
            V23 = v23;
            V24 = v24;
            V31 = v31;
            V32 = v32;
            V33 = v33;
            V34 = v34;
            V41 = v41;
            V42 = v42;
            V43 = v43;
            V44 = v44;
        }
        #endregion

        #region Evaluation
        //private static Matrix BasisMatrix = new Matrix();

        public Vector3 Evaluate(Vector2 coordinates)
        {
            return Evaluate(coordinates.X, coordinates.Y);
        }
        
        public Vector3 Evaluate(float u, float v)
        {
            Vector3 point = new Vector3();
            
            return point;
        }
        #endregion
    }
}
